package com.zang.im.croom.model.dto;

import io.netty.handler.codec.http.websocketx.WebSocketFrame;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

/**
 * @author Zhang Qiang
 * @Date 2019/7/27 16:13
 */
@Data
@Builder(toBuilder = true)
@AllArgsConstructor
@NoArgsConstructor
public class WSMessage implements Serializable {

    private static final long serialVersionUID = 7328679553964878063L;
    /**
      * 用户Id
      */
    private Long uId;

     /**
      * 发送用户id
      */
    private Long toUid;

     /**
      * 发送者id
      */
    private Long sendUid;

     /**
      * 消息id
      */
    private Long msgId;

     /**
      * 用户昵称
      */
    private String userName;

     /**
      * 消息类型 1：txt文本消息
      */
    private int msgType;

     /**
      * 消息内容
      */
    private String msg;

     /**
      * 发送时间
      */
    private Date createAt;


    public static String getMsgKey(Long msgId){
        return "msg_" + msgId;
    }


}
